@echo off
echo 正在安装APK...

REM 检查设备连接
echo 检查ADB设备连接...
adb devices

REM 安装Release APK
if exist "app\build\outputs\apk\release\app-release.apk" (
    echo 正在安装Release APK...
    adb install -r "app\build\outputs\apk\release\app-release.apk"
) else (
    echo Release APK未找到，尝试安装Debug APK...
    if exist "app\build\outputs\apk\debug\app-debug.apk" (
        adb install -r "app\build\outputs\apk\debug\app-debug.apk"
    ) else (
        echo ❌ 未找到APK文件
        pause
        exit /b 1
    )
)

echo.
echo APK安装完成！
echo 正在启动应用...
adb shell am start -n com.example.myapplication/.LoginActivity

echo.
echo 应用已启动，现在可以测试连接功能了。
pause 